package com.xiguaji.tiktok.task.ranking.client;

import com.gugee.tiktok.common.model.mysql.BloggerLog;
import com.gugee.tiktok.common.model.mysql.BloggerMain;
import com.gugee.tiktok.common.model.mysql.BloggerRecord;
import com.xiguaji.tiktok.task.blogger.BloggerService;
import com.xiguaji.tiktok.task.ranking.BloggerRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Optional;

@Component("BloggerClientRanking")
public class BloggerClient {

    @Autowired
    BloggerService bloggerService;

    @Autowired
    BloggerRecordService bloggerRecordService;

    public String getBloggerType(long oUid){
        return bloggerService.getBloggerType(oUid);
    }

    public List<BloggerMain> getBloggerRanking(String bloggerType, int limit){
        return bloggerService.getBloggerRanting(bloggerType,limit);
    }

    public List<BloggerMain> getBloggerEnterpriseRanking(String bloggerType,int limit) {
        return bloggerService.getBloggerEnterpriseRanting(bloggerType,limit);
    }
    public List<BloggerMain> getBloggerRegionRanking(String bloggerType,int limit) {
        return bloggerService.getBloggerRegionRanting(bloggerType,limit);
    }
//
//    public List<BloggerMain> getBloggers(int id,int count){
//        return bloggerService.getBloggers(id,count);
//    }

    public Optional<BloggerLog> getBloggerLogByLogType(int logType){
        return bloggerService.getBloggerLogByLogType(logType);
    }

    public BloggerMain getBloggerByUid(long uid){
        return bloggerService.getBloggerByOUid(uid);
    }

    public List<BloggerRecord> findBloggerRecords(Integer dateCode, String bloggerType){
        return bloggerRecordService.findBloggerRecords(dateCode,bloggerType);
    }

    public Optional<BloggerRecord> findBloggerRecords(Integer dateCode,long uid){
        return bloggerRecordService.findBloggerRecords(dateCode,uid);
    }
}
